package com.slz3.business.module.systemManagement.sysMenu.domain;

import com.slz3.business.frame.annotation.ConfigDomain;
import com.slz3.business.module.systemManagement.sysMenu.repository.SysMenuRepository;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.ColumnDefault;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.List;

@ConfigDomain(repositoryClass = SysMenuRepository.class)
@Entity
@Table(schema = "system_management", name = "sys_menu")
@Data
@EqualsAndHashCode(callSuper = true)
public class SysMenu extends SysMenuEntity {

    /**
     * 自增 Long
     */
    @Column(insertable = false)
    @ColumnDefault("nextval('mishang_old_frame_id_seq')")
    private Long incrementId;

    @Transient
    private SysMenuEntity parentMenu;
    @Transient
    private List<SysMenu> children;
}
